package org.flynenu.ums.dao;

import org.flynenu.ums.dao.impl.RoleDaoImpl;
import org.flynenu.ums.dao.impl.UserDaoImpl;


public class DaoFactory {
	private volatile static UserDao userCell = null;
	private volatile static RoleDao roleCell = null;

	public static UserDao getUserCell(){
		if(userCell == null){
			synchronized(DaoFactory.class){
				if(userCell == null){
					userCell = new UserDaoImpl();
				}
				
			}
		}
		
		return userCell;
	}
	
	public static RoleDao getRoleDao(){
		if(roleCell == null){
			synchronized(DaoFactory.class){
				if(roleCell == null){
					roleCell = new RoleDaoImpl();
				}
				
			}
		}
		
		return roleCell;
	}
	
}
